﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AD.DAL;
using System.Data;
using AD.Model;

namespace AD.BLL
{
    public class NoticeBLL
    {
        public static NoticeMod QueryById(string id)
        {
            try
            {
                List<NoticeMod> users = NoticeDAL.QueryFilterToList(" AutoID=" + id);
                if (users != null && users.Count > 0)
                    return users[0];
            }
            catch
            {
            }
            return null;
        }
        public static int Insert(NoticeMod hepler)
        {
            return NoticeDAL.Insert(hepler);
        }

        public static int Update(NoticeMod hepler)
        {
            return NoticeDAL.Update(hepler);
        }

        public static IList<NoticeMod> QueryByPage(string filter, int pageSize, int index, out int maxCount)
        {
            return NoticeDAL.QueryByPage(filter,pageSize, index, out  maxCount);
        }
        public static NoticeMod QueryFrist(string filter)
        {
            return NoticeDAL.QueryFrist(filter);
        }
        public static int DeleteById(int id)
        {
            return NoticeDAL.DeleteById(id);
        }
        public static List<NoticeMod> QueryFilterToList(string filter)
        {
            return NoticeDAL.QueryFilterToList(filter);
        }

        public static DataTable QueryFilterToTable(string filter)
        {
            return NoticeDAL.QueryFilterToTable(filter);
        }
    }
}